package agent

import (
	"net/http"

	"gitee.com/liuxuezhan/ar-platform/base-common/result"

	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/logic/agent"
	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/svc"
)

// 代理排序枚举
func AgentSortEnumHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		l := agent.NewAgentSortEnumLogic(r.Context(), svcCtx)
		resp, err := l.AgentSortEnum()
		if err != nil {
			result.HttpErrorResult(r.Context(), w, err)
		} else {
			result.HttpSuccessResult(r.Context(), w, resp)
		}
	}
}
